package com.wlstock.funi.model;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.util.Date;

@DatabaseTable
public class TradeHisModel extends BaseModel{
	@DatabaseField (generatedId = true)
	private int id;
	
	@DatabaseField//取时间，作为外键id
	private long linkId;
	
	@DatabaseField
	private String stockNo;

	@DatabaseField
	private String stkName;
	
	@DatabaseField//可用数量
	private int  stkQty;

	@DatabaseField//买入价格
	private String costPrice;
	
	@DatabaseField//收益
	private float profitRate;
	
	@DatabaseField
	private float profitMoney;
	
	@DatabaseField //方向
	private int tradeType;

	@DatabaseField
	private Date createDate = new Date();
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public long getLinkId() {
		return linkId;
	}

	public void setLinkId(long linkId) {
		this.linkId = linkId;
	}

	public String getStockNo() {
		return stockNo;
	}

	public void setStockNo(String stockNo) {
		this.stockNo = stockNo;
	}

	public String getStkName() {
		return stkName;
	}

	public void setStkName(String stkName) {
		this.stkName = stkName;
	}

	public int getStkQty() {
		return stkQty;
	}

	public void setStkQty(int stkQty) {
		this.stkQty = stkQty;
	}

	public String getCostPrice() {
		return costPrice;
	}

	public void setCostPrice(String costPrice) {
		this.costPrice = costPrice;
	}

	public float getProfitRate() {
		return profitRate;
	}

	public void setProfitRate(float profitRate) {
		this.profitRate = profitRate;
	}

	public int getTradeType() {
		return tradeType;
	}

	public void setTradeType(int tradeType) {
		this.tradeType = tradeType;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public void setWithAIModel(AIAccountsModel aiModel) {
		this.stkName = aiModel.getStkName();
		this.stockNo = aiModel.getStkCode();
		this.linkId = aiModel.getLinkId();
		this.costPrice = aiModel.getCostPrice();
		this.stkQty = aiModel.getStkQty();
	}

	public float getProfitMoney() {
		return profitMoney;
	}

	public void setProfitMoney(float profitMoney) {
		this.profitMoney = profitMoney;
	}
}
